# 加油！杨思钦！
# 沉下心来慢慢琢磨，你是最棒的！


"""调用接口，获取验证码，使用第三方识别验证码"""
import uuid
from config import Config

import requests


def get_img():
    uid = str(uuid.uuid4())
    url = Config.HOST + "/captcha.jpg?uuid={uid}"
    response = requests.request(method="get", url=url)
    # content就是二进制的图片文件
    content = response.content
    return content, uid

    # # 可以将图片保存起来，查看
    # with open("v_demo.png", mode="wb") as f:
    #     f.write(content)
    # image_code = base64_api(uname='sqyang', pwd='qaz147258', img="v_demo.png", typeid=3)
